package com.kgar.controller;

import com.kgar.dto.Result;
import com.kgar.entity.pojo.User;
import com.kgar.service.UserService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping
    public Result queryById(){
        return userService.queryById();
    }

    /**
     * 注销用户
     */
    @DeleteMapping
    public Result deleteById(){
        return userService.deleteById();
    }

    @PostMapping("save")
    public Result saveUserInfo(@RequestBody User user){
        return userService.saveUserInfo(user);
    }

    @PutMapping
    public Result updateUser(@RequestBody User user){
        return userService.updateUser(user);
    }

}
